MMBasic now has the facility to add a display driver written entirly in BASIC.

In the initialisation code you need to setup the I/O to the display and execute 
the following command:
    OPTION LCDPANEL USER, hres, vres
where hres and vres are the horiz and vert resolution of the display. 

The initialisation code should be in the library or the first thing in a program.  
 
OPTION LCDPANEL USER will setup pointers to the two BASIC drawing functions 
which are:

  sub MM.USER_RECTANGLE x1%, y1%, x2%, y2%, c%
    ' code to draw a rectangle with the colour c%
  end sub

  sub MM.USER_BITMAP x1%, y1%, width%, height%, scale%, fc%, bc%, bitmap%
    ' code to display a bitmap with foreground colour fc% and background bc%
    ' bitmap% is the address of the bitmap.  Use PEEK() to get the data.
    ' each byte is a horizontal row of pixels starting with the most significant bit
  end sub
